package day8;

import java.util.Date;

/**
 * @author oldliu
 * @since 1.0
 */
public class Thread4 extends Thread {
    public Thread4(String n){
        super(n);
    }

    @Override
    public void run() {
        for(int i=1;i<=20;i++){
            System.out.println(this.getName()+"输出了 "+i+",当前的时间："+new Date());
            super.yield();
        }
    }

    public static void main(String[] args) {
        for(int i=1;i<=6;i++){
            new Thread4("Thread-"+i).start();
        }
    }
}
